﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;

public class CustomRenderPipeline : RenderPipeline {
    CameraRenderer renderer = new CameraRenderer();
    bool useDynamicBatching, useGPUInstancing;
    ShadowSettings shadowSettings;

    public CustomRenderPipeline(
        bool useDynamicBatching_, bool useGPUInstancing_, bool useSRPBatcher_,
        ShadowSettings shadowSettings
        ) {
        this.shadowSettings = shadowSettings;
        useDynamicBatching = useDynamicBatching_;
        useGPUInstancing = useDynamicBatching_;
        GraphicsSettings.useScriptableRenderPipelineBatching = useSRPBatcher_;
        GraphicsSettings.lightsUseLinearIntensity = true;
    }

    protected override void Render(ScriptableRenderContext context_, Camera[] cameras_) {
        foreach (var cam in cameras_) {
            renderer.Render(context_, cam, useDynamicBatching, useGPUInstancing,
                shadowSettings);
        }
    }
}
